package com.service.specialist.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.mapper.specialist.UserZJMapper;
import com.po.UserZJInfo;
import com.service.specialist.UserZJService;
@Service
public class UserZJServiceImp implements UserZJService{
    @Resource(name="userZJMapper")
    private UserZJMapper userZJMapper;
	@Override
	public List<UserZJInfo> getUserZJList(UserZJInfo userzjinfo) {
		List<UserZJInfo> list=userZJMapper.getUserZJList(userzjinfo);
		return list;
	}
	@Override
	public int getUserZJCount(UserZJInfo userzjinfo) {
		int i=userZJMapper.getUserZJCount(userzjinfo);
		return i;
	}
	@Override
	public UserZJInfo getOneUserZJ(String zjid) {
		UserZJInfo info=userZJMapper.getOneUserZJ(zjid);
		return info;
	}
	@Override
	public int updateUserZJ(UserZJInfo userzjinfo) {
		int result;
		if(userzjinfo.getUserzj_birth()!=null){
			result=userZJMapper.updateUserZJBirth(userzjinfo);
		}
		else {
			result=1;
		}
		int i=userZJMapper.updateUserZJ(userzjinfo);
		if(result==1&&i==1)
			return 1;
		else return 0;
	}
	@Override
	public int updateUserZJImage(String pictureurl, String userid) {
		int i=userZJMapper.updateUserZJImage(pictureurl, userid);
		return i;
	}

}
